import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from 'axios'; import OAuth from 'oauth-1.0a'; import { UrlClass } from '../garmin/UrlClass'; import { GCConfig, IOauth1, IOauth1Consumer, IOauth1Token, IOauth2Token } from '../garmin/types'; export declare class HttpClient { client: AxiosInstance; url: UrlClass; config: GCConfig; oauth1Token: IOauth1Token | undefined; oauth2Token: IOauth2Token | undefined; OAUTH_CONSUMER: IOauth1Consumer | undefined; constructor(url: UrlClass, config: GCConfig); fetchOauthConsumer(): Promise; checkTokenVaild(): Promise; get(url: string, config?: AxiosRequestConfig): Promise; post(url: string, data: any, config?: AxiosRequestConfig): Promise; put(url: string, data: any, config?: AxiosRequestConfig): Promise; delete(url: string, config?: AxiosRequestConfig): Promise; setCommonHeader(headers: RawAxiosRequestHeaders): void; handleError(response: AxiosResponse): void; handleHttpError(response: AxiosResponse): void; /** * Login to Garmin Connect * @param username * @param password * @returns {Promise} */ login(username: string, password: string, mfaCallback?: () => Promise): Promise; private getLoginTicket; handleMFA(htmlStr: string): void; handlePageTitle(htmlStr: string): void; handleAccountLocked(htmlStr: string): void; refreshOauth2Token(): Promise; getOauth1Token(ticket: string): Promise; getOauthClient(consumer: IOauth1Consumer): OAuth; exchange(oauth1: IOauth1): Promise; setOauth2TokenExpiresAt(token: IOauth2Token): IOauth2Token; }